<?php

/*
 * 载入器，载入各种对象，如：model,control,db
 * and open the template in the editor.
 */
class Loader
{
    static private $loadlist=array();
    //载入方法,载入各种对象.
    static public function load($obj)
    {
        global $_G;
        
        if(in_array($obj, $_G['loader']))
        {
           
            if(empty(self::$loadlist[$obj]))
            {
                $tmpobj=ucfirst($obj);
                self::$loadlist[$obj]=new $tmpobj();
               
                return self::$loadlist[$obj];
            }
            else
                return self::$loadlist[$obj];
        }
        else
        {
            return null;
        }
        
        
    }
}
?>
